package example.day06;

public class OrderTest2 {

    public static void main(String[] args) {

        // new Order()调的是Order类上的无参构造
        Order o1 = new Order();
        System.out.println(o1.orderId);
        System.out.println(o1.userId);
        System.out.println(o1.amount);

        Order o2 = new Order();
        System.out.println(o2.orderId);
        System.out.println(o2.userId);

        System.out.println("--------上面是无参构造的调用----下面是有参构造的调用");

        // 调用Order类上的有参构造方法来构造一个对象
        // 构造好的对象中，直接就拥有了各个初始化数据
        Order o3 = new Order("o3","u3",80.5,78.5,"上计信息楼709","2021-03-08");
        System.out.println(o3.orderId);
        System.out.println(o3.userId);
        System.out.println(o3.amount);

    }


}
